home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 050a / fold30.zip / FOLD.DOC < prev    next >
Text File  |  1993-01-31  |  30KB  |  761 lines

  1.  
  2.                                FOLD-and-PRINT
  3.                                  version 3.0
  4.  
  5.                                 User's Manual
  6.  
  7.                           (C) Konrad Budych 1989-93
  8.  
  9.  
  10.         FOLD-and-PRINT is a utility that allows you to print an ASCII text in
  11. a multi-column format using either single sheets or fanfold paper on
  12. (probably) any printer.  This saves paper costs and makes it easier to read
  13. texts.  It is useful when you want to print long source code listings,
  14. software documentation, or any long and unformatted ASCII texts.
  15.  
  16.         FOLD-and-PRINT always prints in text mode to avoid slow graphics
  17. printing and may use all features that are specific to your printer as it is
  18. completely configurable.  It is possible to print selected pages of the text:
  19. even-, or odd-numbered, starting from, or ending after given page.  You may
  20. prepare easily printouts that you may bind in a binder.  All features are
  21. described later in this manual.
  22.  
  23.         I have been using and writing this program for more than 2 years.  It
  24. was improved, changed, and rewritten many times.  As I find it really useful I
  25. think it may be useful to others too.  Just give it a try, play with some
  26. configurations, and very soon you will discover its value.
  27.  
  28.         Real life example: suppose you want to print both parts of the user's
  29. guide to Pretty Good Privacy, popular freeware public-key encryption program.
  30. It takes 74 pages if you just send both files to printer.  But it takes only
  31. 23 pages when you remove page headings and print joined manual parts with
  32. FOLD-and-PRINT in two columns on any ESC/P compatible printer using 80 lines
  33. of 160 characters per page which is still very readable.  It is less than one
  34. third of the original amount of paper necessary to make the printout...
  35.  
  36.  
  37.  
  38.  
  39. WHAT DOES FOLD-and-PRINT EXACTLY DO?
  40. ====================================
  41.  
  42.         When you print a text with 'COPY ATEXT.EXT PRN', 'PRINT ATEXT.EXT', or
  43. something similar, you usually get a sheet or two (or hundred) of paper or few
  44. meters (or miles) of fanfold paper that has text printed only near the left
  45. margin, has about 50 to 60 lines on page, and is printed with font which you
  46. can set on the printer's panel.
  47.  
  48.         When you browse through the user's manual of any printer, you should
  49. see, that the printer can print in many modes that are mostly unused by
  50. professional, big applications.  These applications usually offer much more
  51. features, but they print mostly in graphic modes, and if you have a slow
  52. printer you sooner or later stop using them for printing ASCII texts (if you
  53. have ever started).
  54.  
  55.         Most dot mattrix printers can emulate ESC/P commands.  This commands
  56. allow to select different font pitches and line spacings.  It is no magic to
  57. print 80 lines of 160 characters on a page.  This is still very readable and
  58. there is about 3 times more text on such a page than when you use default 55
  59. lines of 80 characters.  Of course if your printer does not support ESC/P
  60. commands you may still use FOLD-and-PRINT.  Only you will probably have to
  61. experiment with different features of your printer.
  62.  
  63.         What FOLD-and-PRINT really does is this: it formats a given ASCII
  64. texts into multi-column format, and sends it to the printer, page by page,
  65. preceded and followed by some control codes.  The page length, width, margins,
  66. line spacing, etc.  are all up to you.  Just give FOLD-and-PRINT control codes
  67. to be sent to printer, tell it how many lines fit on a page, how many
  68. characters fit in a line, and that's all!  You may make your printouts even in
  69. 9 columns from now!
  70.  
  71.         To find more details on how to configure FOLD-and-PRINT see below.  If
  72. your printer supports ESC/P (most printers do), you may test using the example
  73. configurations included in the package.
  74.  
  75.  
  76.  
  77.  
  78. HOW TO INSTALL FOLD-and-PRINT?
  79. ==============================
  80.  
  81.         Follow these simple rules when installing FOLD-and-PRINT:
  82.  
  83. * All *.P files should be in the same directory in which you keep FOLD.EXE.
  84. * It is nice to be able to run FOLD-and-PRINT from any directory and drive.
  85. * Do not install FOLD-and-PRINT if you do not have DOS version 3.0 or newer.
  86.  
  87.         You may just copy FOLD.EXE and *.P files to some directory listed in
  88. your PATH, or create separate directory (like C:\FOLD) and create a BATch file
  89. in one of directories listed in PATH.  The batch may look like this:
  90.  
  91.                 @echo off
  92.                 set fold=-a -w -i
  93.                 c:\fold\fold.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
  94.                 set fold=
  95.                 echo on
  96.  
  97.         The FOLD environmental variable is used to turn on default switches.
  98. You may SET it in the batch, in AUTOEXEC.BAT, or do not set it at all if you
  99. do not need it.  See below for switches description.
  100.  
  101.         After you have learned how to use and configure FOLD-and-PRINT, do not
  102. keep *.DOC files on your hard disk --- the manuals are longer than the program
  103. itself!  Just hide the original archive file on some forgotten diskette in
  104. case you ever want to read this text again or your hard disk crashes.
  105.  
  106.  
  107.  
  108.  
  109. USING FOLD-and-PRINT
  110. ====================
  111.  
  112.         First you will be presented some examples introducing step by step the
  113. major features of FOLD-and-PRINT.  The complete syntax and full switches
  114. description is presented at the end of this section.
  115.  
  116.         All these examples assume that you have FOLD-and-PRINT configured and
  117. ready to use.  If your printer supports ESC/P, FOLD-and-PRINT is ready to use
  118. with default parameters: the condensed Elite font of 80 lines of 160
  119. characters per page is used by default.  Use another mode by copying any .P
  120. file to DEFAULT.P or (which is better) using 'p' switch.  If your printer does
  121. not support ESC/P commands you will have to configure FOLD-and-PRINT first.
  122. See below for details.
  123.  
  124.  
  125.  
  126.  
  127. QUICK START
  128. -----------
  129.  
  130.         To print this file in two columns run:
  131.  
  132.                 FOLD -2 FOLD.DOC
  133.  
  134. You will be prompted for confirmation before the printing starts, and before
  135. each page.  Pressing [ESC] always exits to DOS.
  136.  
  137.         If you want to know how many pages of the text will be produced by
  138. FOLD-and-PRINT run:
  139.  
  140.                 FOLD FOLD.DOC
  141.  
  142. FOLD-and-PRINT will analyze the text first, and display how many pages, and
  143. how many 'cuts' (see below) you will get if you use 1, 2, 3, up to 9 columns
  144. of text.  Then you will be prompted to press [1], [2], ...  [9] to start or
  145. [ESC] to quit.  You may always force the analyzis of a text using 'a' switch:
  146.  
  147.                 FOLD -2 -a FOLD.DOC
  148.  
  149. In this case when prompted you just have to press [ENTER] to use 2 columns.
  150. Of course, thanks to 'a' switch, you may use 3 or 8 columns even if you
  151. specified '2' in command line.
  152.  
  153.  
  154.  
  155.  
  156. WHEN COLUMN IS TOO NARROW
  157. -------------------------
  158.  
  159.         When column is too narrow a 'cut' occurs.  Normally the text which
  160. would not fit in a column will be printed in the same column in the next line.
  161. The number of cuts in texts can be determined in text analysis.
  162.  
  163.         When the text is cut, a word may be broken in any place.  When many
  164. words in text are broken, the text becomes illegible.  To prevent this, you
  165. may use 'w' switch.  This makes FOLD-and-PRINT not break words in the middle,
  166. but move an entire word to the next line in the same column.  For example:
  167.  
  168.                 FOLD -4 FOLD.DOC
  169.  
  170. would produce a very hard to read printout, but
  171.  
  172.                 FOLD -4 -w FOLD.DOC
  173.  
  174. would produce a not so hard to read printout.  Sometimes when a word is longer
  175. than the width of a column it is not possible to leave it intact.  In such
  176. cases FOLD-and-PRINT will behave as if the 'w' switch was off.
  177.  
  178.         You may not want to print the line endings that do not fit in a
  179. column.  They may contain less important information (like comments in
  180. assembly language source code).  But if they are hundreds of cuts the text
  181. becomes hard to understand if you omit them.  To truncate lines that do not
  182. fit in a cloumn use 't' switch, for example, compare the analysis rezults of:
  183.  
  184.                 FOLD -t FOLD.DOC
  185.  
  186. and
  187.  
  188.                 FOLD FOLD.DOC
  189.  
  190. especially in 4 or more column modes.
  191.  
  192.  
  193.  
  194.  
  195. WHEN A RIBBON IS WEAK
  196. ---------------------
  197.  
  198.         If you print a lot of texts, sooner or later a ribbon in your printer
  199. will become weak and printouts gray instead of black.  You may of course
  200. replace the ribbon, but if it is weak and you very much want to print
  201. something in black FOLD-and-PRINT can help.  Use 'b' switch to print each line
  202. not once but twice, or 'b3' to print each line 3 times up to 'b9' which tells
  203. FOLD-and-PRINT to print each line 9 times.  The latter is cruel for the
  204. printer, but if you cannot afford a new ribbon...  For example:
  205.  
  206.                 FOLD -2 -b3 FOLD.DOC
  207.  
  208. will print FOLD.DOC in two columns each line three times.
  209.  
  210.  
  211.  
  212.  
  213. WHEN A TEXT IS LONG
  214. -------------------
  215.  
  216.         When a text you print is very long and you print it on fanfold paper
  217. or you have a sheet feeder, you may do not want to sit and look the at printer
  218. working, and pressing [ENTER] from time to time to confirm printing of
  219. succeeding pages.  Or you may want to print first the left pages and then the
  220. right pages on the same sheets to make a book-like printout.  FOLD-and-PRINT
  221. can help in each situation:
  222.  
  223.                 FOLD -n -2 FOLD.DOC
  224.  
  225. This will print FOLD.DOC in two columns but you will be able to leave the
  226. printer unattended as no user action will be necessary.  You only have to
  227. confirm the start of printing, but you may omit even this nuisance:
  228.  
  229.                 FOLD -n -c -2 FOLD.DOC
  230.  
  231. This will automatically start printing of FOLD.DOC and continue without any
  232. prompts, unless you force the text analyzis with 'a' switch in which case you
  233. will have to specify number of columns to be used.
  234.  
  235.         If you want to print only even- or odd-numbered pages of a text use
  236. 'e' and 'o' switches:
  237.  
  238.                 FOLD -o -n FOLD.DOC
  239.  
  240.                 FOLD -e -n FOLD.DOC
  241.  
  242. These two commands will cause printing the one half of FOLD.DOC first and then
  243. the other half next.  Both halves will be printed in no-wait mode described
  244. above.
  245.  
  246.         To print only specified range of pages you may use 'f', 'l', and 's'
  247. switches.  Here are some examples:
  248.  
  249.                 FOLD -f3 FOLD.DOC
  250.  
  251. This will print FOLD.DOC starting with page 3.
  252.  
  253.                 FOLD -f3 -l4 FOLD.DOC
  254.  
  255. This will print FOLD.DOC starting with page 3 and ending after page 4.
  256.  
  257.                 FOLD -s4 FOLD.DOC
  258.  
  259. This will print 4th page of FOLD.DOC.  Please note that '-s4' is a shortcut
  260. for '-f4 -l4 -e- -o-' and that 'e' and 'o' switches can be combined with 'f'
  261. and 'l'.
  262.  
  263.  
  264.  
  265.  
  266. WHEN YOU HAVE A BINDER
  267. ----------------------
  268.  
  269.         If you like to keep all sheets of your printout tightly bound
  270. together, you may tell FOLD-and-PRINT to leave margins which will allow
  271. binding sheets:
  272.  
  273.                 FOLD -2 -m FOLD.DOC
  274.  
  275. This will print FOLD.DOC in two columns.  Right pages (odd-numbered) will have
  276. a left margin and left pages (even-numbered) will have a right margin so the
  277. printout will be excellent to be put in a binder.
  278.  
  279.         Please note that all columns are more narrow if use use this switch.
  280. This may increase the number of cuts in a text.
  281.  
  282.         The width of the binder margin can be set up in the printer definition
  283. file (see below).
  284.  
  285.  
  286.  
  287. COMPLETE SYNTAX AND SWITCHES DESCRIPTION
  288. ----------------------------------------
  289.  
  290.         You may run 'FOLD -?' to see the help screen.
  291.  
  292.         The full syntax is as follows:
  293.  
  294.                 FOLD [switches] filename [switches]
  295.  
  296.         Switches may be preceded by either '-' or '/'.  Switches without
  297. parameters toggle their state each time they occur unless they are followed by
  298. '+' or '-'.  Switches must be separated.  The content of environmental
  299. variable FOLD is always scanned before any command line arguments, so you may
  300. turn on some switches using this variable.
  301.  
  302.         Filename is any legal DOS filename with optional drive and path.
  303. Wildcards ('*' and '?') are not allowed and only one file name can be given.
  304.  
  305.         Single '-' or '/' in command line disables switch scanning.  This
  306. feature may be used to print a file with the name beginning with '-'.
  307.  
  308.         Some switches automatically turn on or off other switches.  See
  309. detailed switches description below for more details.
  310.  
  311.         Here is the full list of switches that are available in FOLD-and-PRINT
  312. version 3.0:
  313.  
  314.   -1, -2, -3,... -9 : number of columns
  315.   -a : force text analyzis
  316.   -t : truncate lines that don't fit in a column
  317.   -w : use word wrap when breaking long lines
  318.   -e : print even-numbered pages only (2, 4, 6, ...)
  319.   -o : print odd-numbered pages only (1, 3, 5, ...)
  320.   -m : make binder margins
  321.   -i : print 'This space intentionally left blank' on last page
  322.   -zfilespec : set output file to <filespec>
  323.   -pfilespec : use printer def file <filespec>
  324.   -fnnn : first page to print is nnn (default: 1)
  325.   -lnnn : last page to print is nnn (default: 9999)
  326.   -snnn : select page to print
  327.   -b[n] : print each line n times
  328.   -n : no pause after page for paper change
  329.   -c : start printing without waiting for confirmation
  330.   -h, -? : display help screen
  331.  
  332. And here is the detailed description of all switches:
  333.  
  334. -1, -2, -3,...  -9
  335.  
  336.         These switches can be used to specify the desired number of columns
  337. which FOLD-and-PRINT should use when printing text.  If none of them is
  338. specified, FOLD-and-PRINT will analyze the text first and then prompt user to
  339. specify the number of columns.  However if 'a' switch is on, FOLD-and-PRINT
  340. will always analyze the text.
  341.  
  342.         If any two of these switches are given the last is valid.  Everything
  343. after the digit is ignored (including '+' and '-').
  344.  
  345.  
  346.   -a
  347.  
  348.         This switch forces the text analyzis.  FOLD-and-PRINT read the text
  349. first and display how many pages, and how many cuts you will get if you use 1,
  350. 2, 3, up to 9 columns of text.  Then you will be prompted to press [1], [2],
  351. ...  [9] to start or [ESC] to quit.
  352.  
  353.     The analyzis is very fast: on 386 40 MHz it was around 3500 lines of
  354. the text per second.
  355.  
  356.     Please note, that you will always be prompted to press a key, even if
  357. you turn on 'c' and 'n' switches.
  358.  
  359.  
  360.   -t
  361.  
  362.         This switch will tell FOLD-and-PRINT to truncate lines that don't fit
  363. in a column.  The text that is truncated will not be printed anywhere on the
  364. page.  Normally too long lines are printed in 2 or more lines in a column.
  365.  
  366.  
  367.   -w
  368.  
  369.         This switch will tell FOLD-and-PRINT to use word wrap when breaking
  370. too long lines that do not fit in a column.  When 't' switch is on, however,
  371. 'w' is ignored.
  372.  
  373.  
  374.   -e
  375.  
  376.         With this switch on, FOLD-and-PRINT will print only even-numbered
  377. pages of the specified range.  To be precise: it will not print odd-numbered
  378. pages.
  379.  
  380.  
  381.   -o
  382.  
  383.         With this switch on, FOLD-and-PRINT will print only odd-numbered pages
  384. of the specified range.  To be precise: it will not print even-numbered pages.
  385.  
  386.  
  387.   -m
  388.  
  389.         This switch tells FOLD-and-PRINT to make margins which will make easy
  390. to put a printout into a binder.  The width of the margin is defined in the
  391. printer definition file (see below).
  392.  
  393.  
  394.   -i
  395.  
  396.         There is no much use of this switch --- it makes FOLD-and-PRINT print
  397. on the last page, which is usually not filled up, the following text in the
  398. middle of the blank space:
  399.  
  400.                 [This space has been intentionally left blank]
  401.  
  402.  
  403.   -zfilespec
  404.  
  405.         When this parameter is given in command line FOLD-and-PRINT will not
  406. send the text being printed to a printer (ie.  file PRN) but to the file
  407. specified after 'z'.  filespec is any valid file name.  If the specified file
  408. exist it will be overwritten without a warning.
  409.  
  410.         Please note that there is no space between 'z' and 'filespec'.  If
  411. this parameter is used twice or more, the filespec in the last occurance is
  412. used by FOLD-and-PRINT.
  413.  
  414.  
  415.   -pfilespec
  416.  
  417.         Normally FOLD-and-PRINT uses prinetr control codes, page layout, and
  418. other configurable information from the printer definition file DEFAULT.P.  If
  419. you want to use another printer definition file use 'p' switch followed by
  420. file specification.  The default extension which you can omit is '.P'.  The
  421. file is first searched for in the current directory and then in the directory
  422. in which FOLD.EXE resides.
  423.  
  424.         Please note that there is no space between 'p' and 'filespec'.  If
  425. this parameter is used twice or more, the filespec in the last occurance is
  426. used by FOLD-and-PRINT.
  427.  
  428.  
  429.   -fnnn
  430.  
  431.         nnn is a number form 1 to 9999.  All pages before the nnn'th page will
  432. not be printed.  The first printed page will be nnn'th or the one after nnn'th
  433. if 'e' and 'o' switches does not allow printing of the nnn'th page.
  434.  
  435.         Please note that there is no space between 'f' and the following
  436. number.  If this parameter is used twice or more, the number in the last
  437. occurance is used by FOLD-and-PRINT.
  438.  
  439.  
  440.   -lnnn
  441.  
  442.         nnn is a number form 1 to 9999.  All pages after the nnn'th page will
  443. not be printed.  The last printed page will be nnn'th or the one before nnn'th
  444. if 'e' and 'o' switches does not allow printing of the nnn'th page.
  445.  
  446.         Again please note that there is no space between 'l' and the following
  447. number.  If this parameter is used twice or more, the number in the last
  448. occurance is used by FOLD-and-PRINT.
  449.  
  450.  
  451.   -snnn
  452.  
  453.         nnn is a number form 1 to 9999.  Only the nnn'th page will be printed.
  454. The '-snnn' is a shortcut for '-fnnn -lnnn -e- -o-'.
  455.  
  456.         Once again please note that there is no space between 's' and the
  457. following number.  If this parameter is used twice or more, ...  etc...etc...
  458.  
  459.  
  460.   -b[n]
  461.  
  462.         n is a digit 1, 2, up to 9. It can be omitted and in this case 2 is
  463. assumed.  The '-b-' is the same as '-b1'.  FOLD-and-PRINT will boldface a
  464. printout --- each line of text will be printed n times without a linefeed.
  465.  
  466.         Do please note that there is no space between 'b'...etc...  And if
  467. this parameter is used twice...etc..etc..
  468.  
  469.  
  470.   -n
  471.  
  472.         Normally FOLD-and-PRINT before it starts printing a given page it
  473. stops --- allowing you to change the paper --- and displays a question like
  474. this:
  475.  
  476.                 Page 4: reading....  print (Y/n/a)?
  477.  
  478. You may press [Y] (or [ENTER]) to print this page, [N] not to print, or [A] to
  479. print this and all following pages without the prompts.  [ESC] aborts program.
  480. If 'n' switch is used FOLD-and-PRINT does not ask these questions.
  481.  
  482.  
  483.   -c
  484.  
  485.         Normally FOLD-and-PRINT before it starts printing at all displays a
  486. question like this:
  487.  
  488.                 Confirm: start printing (Y/n)?
  489.  
  490. You may press [Y] (or [ENTER]) to print this page, [N] (or [ESC]) not to print
  491. and return to DOS.  If 'n' switch is used FOLD-and-PRINT does not ask this
  492. question.
  493.  
  494.  
  495.   -h, -?
  496.  
  497.         Use this to display the help screen.  FOLD-and-PRINT will not do
  498. anything else if this switch is given.  It cannot be turned on and off.
  499.  
  500.  
  501.  
  502.  
  503. HINTS
  504. -----
  505.  
  506.         Here are some hints which you may find helpful in using
  507. FOLD-and-PRINT.  Please also have a look at hints after the 'Configuring...'
  508. section.
  509.  
  510.         * FOLD-and-PRINT can print in one column too.  If you want to print a
  511. text in one column with the designed-by-you headers and footers, and have a
  512. all features of FOLD-and-PRINT, just tell FOLD-and-PRINT to use 1 column.  For
  513. example:
  514.  
  515.                 FOLD -1 SOMETEXT.ASC
  516.  
  517.         * The text analysis is very helpful; you may want to use 'a' switch in
  518. the FOLD variable.  Before you print anything you may look at what number of
  519. columns will be the best for a text --- minimum cuts and pages.
  520.  
  521.         * If in the analysis you see that the last page is filled in less than
  522. 10 percent you may want to remove some blank lines from the text to make it
  523. fit on fewer pages.  Especially if the text contains a groups of more than one
  524. empty line.
  525.  
  526.         * All tabs in the text being printed are expanded to spaces in the
  527. usual manner.  All trailing spaces are removed from the input text to avoid
  528. breaking blank lines.
  529.  
  530.  
  531.  
  532.  
  533. LASER PRINTERS
  534. --------------
  535.  
  536.     I never have an opportunity to print something with FOLD-and-PRINT on
  537. a laser printer.  I have no idea what will happen if you try.  Maybe it will
  538. work, maybe it will not.  It surely will not do any harm to the printer, so
  539. you may try...
  540.  
  541.  
  542.  
  543.  
  544. COFIGURING FOLD-and-PRINT
  545. =========================
  546.  
  547.         FOLD-and-PRINT uses printer definition files to make the full use of
  548. specific capabilities of your printer.  The printer definition file is an
  549. ASCII file that contains all data needed by FOLD-and-PRINT to print a text in
  550. the specific mode.
  551.  
  552.         A single printer definition file contains information about page size
  553. and layout (length of the page in lines, width of the line in characters, the
  554. number of lines at the top and bottom of the page used for margins, the
  555. position within these margins of a header and a footer, and in the end a text
  556. of the header and the footer) and information needed to correctly print in
  557. this mode (printer control codes used to initialize and terminate printing
  558. mode and codes to be printed before and after each page).
  559.  
  560.  
  561.  
  562.  
  563. SAMPLE PRINTER DEFINITION FILE ------------------------------
  564.  
  565.         The structure of a printer definition file is very simple and very
  566. rigorous.  It will be described in detail with the use of an example.  Here it
  567. is one of the example printer definition files (the left margin of two tabs
  568. and line number are NOT included in the real file --- DEFAULT.P --- and are
  569. only used to explain the contents of the file in this documentation and for
  570. further explanation):
  571.  
  572.  
  573.         1       *** Fold 3.0 printer definition file ***
  574.         2       any ESC/P compatible printer
  575.         3       condensed Elite
  576.         4       85 160 2 3 1 3 10
  577.         5       This is '%*' printed %B %d, %Y.
  578.         6       Page %# of '%*'.
  579.         7       \1B@\0F\1B8\1BM\1B0\1BR\00\1Bt\01\1B6
  580.         8       \1B@\07
  581.         9
  582.         10      \0C
  583.         11      *** End of printer definition file ***
  584.  
  585.         The first and the last line (beginning with '***') are necessary for
  586. FOLD-and-PRINT and always have the same contents.  Everything after 11th line
  587. is ignored.
  588.  
  589.         The 2nd and 3rd line contain the text describing your printer (line 2)
  590. and the print mode which is used (line 3).  They are only displayed on the
  591. screen and have no meaning to 'the real work'.
  592.  
  593.         The 4th line contains 7 numbers and they are respectively:
  594. * the length of the page in lines (85 in the example)
  595. * the width of the line in characters (160 in the example)
  596. * the number of empty lines at the top of page used as margin (2)
  597. * the number of empty lines at the bottom of page used as margin (3)
  598. * the position of the line with header within the top margin (1)
  599. * the position of the line with footer within the bottom margin (3)
  600. * the width of binder margin (10 characters)
  601.  
  602.         If the last two numbers are out of range defined by 3rd and 4th
  603. number, the header and/or footer will not be printed.
  604.  
  605.         The 5th line contains the header text and the 6th one --- the footer.
  606. This can be any text of your choice and you may use some special symbols there
  607. (they all begin with '%', a time is the time of printing):
  608.  
  609. %F or %*        name of printed file
  610. %N or %#        current page number
  611. %a or %A        weekday name (abbr or full)
  612. %b or %B        month name (abbr or full)
  613. %c              Date and time (DON'T USE! See notes below)
  614. %d              2 digit day of month (01..31)
  615. %H or %I        2 digit hour (00..23 or 01..12)
  616. %j              3 digit day of year
  617. %m              2 digit month decimal (01..12)
  618. %M              2 digit minute (00..59)
  619. %p              AM or PM
  620. %S              2 digit second (00..59)
  621. %U or %W        2 digit week number (Sun is 1st or Mon is 1st day of week)
  622. %w              Weekday decimal (0 = Sunday)
  623. %y or %Y        Year (00..99 or 4 digit)
  624. %x              Date
  625. %X              Time
  626. %Z              Time zone name (DON'T USE! See notes below)
  627. %%              %
  628.  
  629. You should not use %c which gives date and time because it also appends
  630. new-line characters and this may spoil your calculations (two lines printed
  631. instead of one).  Also %Z should not be used unless you have environmental
  632. variable TZ set properly --- this variable describes the time difference
  633. between your time zone and Greenwich Mean Time.  I will not describe its
  634. format here and you are unlikely to use time zone name as a part of the header
  635. in your printouts.  But if you really want --- please see the description of
  636. 'strftime' and 'tzset' C library functions for details in any serious C
  637. compiler manuals.
  638.  
  639.         Lines 7 thru 10 contain printer control codes which are used:
  640. * to initialize the printer and turn on the desired print mode (line 7)
  641. * to return the printer to default mode after printing is complete (line 8)
  642. * to initialize printing of each page (line 9)
  643. * to end printing of each page (line 10)
  644.  
  645.         Non-visible control codes or non-ASCII charcters can be entered as
  646. hexadecimal codes in the format '\nn' (without quotes) where nn are exactly
  647. two hex digits (0..9, A..F).  For example \1B is ESC (ASCII 27) character.
  648.  
  649.         In the example shown above we initialize the printer with ESC @
  650. (standard initialize for ESC/P printers) \0F (= SI condensed printing) ESC 8
  651. (ignore out of paper --- alows printing more on the page) ESC M (Elite pitch)
  652. ESC R 0 ESC t 1 ESC 6 (use IBM character set I, allow printing upper codes,
  653. and use US characters --- this is not important, but allows printing texts
  654. with characters > 128).  We de-initialize printer with ESC @ BELL (some
  655. printers rings when they receive bell character and this let you know that
  656. printing is finished).  After each page we send FF (form feed) to spit out the
  657. page.
  658.  
  659.  
  660.  
  661.  
  662. HOW DOES FOLD-and-PRINT USE THE PRINTER DEFINITION FILE?
  663. --------------------------------------------------------
  664.  
  665.         Here is the detailed step-by-step description of what use
  666. FOLD-and-PRINT makes of each item in the printer definition file:
  667.  
  668.         Lines beginning with '***' are ignored, but necessary; lines 2 and 3
  669. are displayed on-screen and also ignored.  Numbers in the 3rd line (PL - page
  670. length, LW - line width, MT - top margin, MB - bottom margin, LH - line with
  671. header, LF - line with footer, BM - binder margin; BM is internally reset to
  672. zero if 'm' switch is off) are used to calculate column width (which is equal
  673. to: (LW - BM) / #_of_columns - 1) and some other numbers...
  674.  
  675.         FOLD-and-PRINT starts with sending control codes from line 7 to the
  676. printer.  Then for the each page it repeats:
  677.  
  678. * sending control codes from line 9
  679.  
  680. * printing PL lines of which:
  681.  
  682.   ** first MT lines are blank except for LH'th line which contains header as
  683.      found in line 5 with expanded symbols beginning with '%'
  684.  
  685.   ** next PL - (MT + MB) contain a text formatted in a number of columns of
  686.      your choice (2 to 9)
  687.  
  688.   ** last MB lines are blank except for LF'th line which contains footer as
  689.      found in line 6 with expanded symbols beginning with '%'
  690.  
  691. * printing control codes from line 10
  692.  
  693. The printing is terminated with sending control characters from line 8.
  694.  
  695.         Each line of text contains a pair of CR and LF characters at the end
  696. so you must turn off auto line feed feature of your printer if it on.  Surely
  697. it is off --- most programs require that it is off.
  698.  
  699.         It is all that you need to set up your printer.  Please remember that
  700. FOLD-and-PRINT absolutely relies on you and assumes that you configured it
  701. correctly.  If the printer prints strange things --- it is most likely your
  702. fault!  Please read 'Hints...' below for the last help on configuring.
  703.  
  704.  
  705.  
  706.  
  707. HINTS AND TROUBLESHOOTING
  708. -------------------------
  709.  
  710.         Here are some notes which you may find helpful in configuring
  711. FOLD-and-PRINT and if you have troubles with FOLD-and-PRINT:
  712.  
  713.         * If every other line printed is full and every another is not, and
  714. page does not fit on a single sheet, you decrease the value of line width
  715. (line is simply too long) or change some codes to decrease character pitch.
  716.  
  717.         * If line spacing is too large, turn off the auto line feed feature in
  718. your printer or put in printer definition file some codes which decrease line
  719. spacing.
  720.  
  721.         * If a page does not fit on a single sheet of paper (eg.  the footer
  722. is printed on the next sheet) reduce the page length value or make printer
  723. ignore the end of paper (the latter is often better --- it is possible to
  724. print the footer at the very end of the sheet).
  725.  
  726.         * When you use fanfold paper always turn off the skip over perforation
  727. and adjust top and bottom margins.
  728.  
  729.         * If you use fanfold paper and the second (and next) page(s) do(es)
  730. not start at the same position as first, calculate page length, divide by line
  731. spacing and put apropriate values in the printer definition file, or...
  732.  
  733.         * If you use fanfold paper and the second (and next) page(s) do(es)
  734. not start at the same position as first, calculate page length, put codes to
  735. set this value in line 7 (printer initialization) and add FF (form feed) to
  736. line 10.
  737.  
  738.         * If you use a laser printer you may be in trouble --- I have had no
  739. opportunity to find out what FOLD-and-PRINT does with laser printers...
  740.  
  741.  
  742.  
  743.  
  744. FINAL NOTES
  745. ===========
  746.  
  747.         Some legal issues and other information are not included in this part
  748. of the manual --- they are not necessary here and may annoy someone who wants
  749. to get some help out of this text and does not want to browse through revision
  750. history, acknowledgements, etc.  Also such information may annoy much more if
  751. you have a habit of printing software documentation.
  752.  
  753.         So please have a look at FOLDADD.DOC sometime...
  754.  
  755.  
  756.  
  757.  
  758.                              End of User's Manual
  759.                              ********************
  760.  
  761.